import request from '/@/utils/request';

export const getPage = (query: any) =>
	request({
		url: '/mall-order/orderinfo/page',
		method: 'get',
		params: query,
	});

export const getById = (id: string) =>
	request({
		url: '/mall-order/orderinfo/' + id,
		method: 'get',
	});

export const addObj = (data: any) =>
	request({
		url: '/mall-order/orderinfo',
		method: 'post',
		data,
	});

export const editObj = (data: any) =>
	request({
		url: '/mall-order/orderinfo',
		method: 'put',
		data,
	});

export const delObj = (id: string) =>
	request({
		url: '/mall-order/orderinfo/' + id,
		method: 'delete',
	});

export const getStatistics = (query: any) =>
	request({
		url: '/mall-order/orderinfo/statistics',
		method: 'get',
		params: query,
	});

export const getCount = () =>
	request({
		url: '/mall-order/orderinfo/count',
		method: 'get',
	});

export const deliverOrder = (data: any) =>
	request({
		url: '/mall-order/orderinfo/deliver',
		method: 'post',
		data,
	});

export const cancelObj = (id: string) =>
	request({
		url: '/mall-order/orderinfo/cancel/' + id,
		method: 'get',
	});

export const selfFetchOrder = (data: any) =>
	request({
		url: '/mall-order/orderinfo/selffetch',
		method: 'post',
		data,
	});
